﻿
namespace gbL.NetBoard.Filters
{
    public class FromFilter : IEntryFilter<object>
    {
        private readonly ObjectEqualityFilter _internalFilter = new ObjectEqualityFilter();

        public void AddFilter(object owner, object toFilter)
        {
            _internalFilter.AddFilter(owner, toFilter);
        }

        public void Precalculate(IBlackboardEntry toTest)
        {
            // not needed
        }

        public bool HasFilter(object owner)
        {
            return _internalFilter.HasFilter(owner);
        }

        public bool IsAllowed(object owner, IBlackboardEntry toTest)
        {
            return _internalFilter.IsAllowed(owner, toTest.From);
        }
    }
}
